﻿using Framework.Ddd.Application.Contracts.Dtos;
using my.abp.Domain.Shared.Entities;
using my.abp.Domain.Shared.Enums;
using System.ComponentModel.DataAnnotations;

namespace my.abp.Application.Contracts.Dtos.User
{
	public class PageUserInput : PagedAllResultRequestDto
	{
		/// <summary>
		/// 账号
		/// </summary>
		public string Account { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		public string Name { get; set; }

		/// <summary>
		/// 手机号
		/// </summary>
		public string Phone { get; set; }

		/// <summary>
		/// 查询时所选机构Id
		/// </summary>
		public long OrgId { get; set; }
	}

	public class UpdateUserInput : AddUserInput
	{
		public long Id { get; set; }
	}

	public class DeleteUserInput : BaseIdInput
	{
		/// <summary>
		/// 机构Id
		/// </summary>
		public long OrgId { get; set; }
	}

	public class AddUserInput
	{
		/// <summary>
		/// 账号
		/// </summary>
		[Required(ErrorMessage = "账号不能为空")]
		public string Account { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		[Required(ErrorMessage = "姓名不能为空")]
		public string Name { get; set; }

		/// <summary>
		/// 所选机构Id
		/// </summary>
		[Required(ErrorMessage = "所选机构不能为空")]
		public long OrgId { get; set; }

		/// <summary>
		/// 角色集合
		/// </summary>
		public List<long> RoleIdList { get; set; }

		/// <summary>
		/// 扩展机构集合
		/// </summary>
		public List<long>? ExtOrgIdList { get; set; }
	}

	public class UserInput : BaseIdInput
	{
		/// <summary>
		/// 状态
		/// </summary>
		public StatusEnum Status { get; set; }
	}

	public class ChangePwdInput
	{
		/// <summary>
		/// 当前密码
		/// </summary>
		[Required(ErrorMessage = "当前密码不能为空")]
		public string PasswordOld { get; set; }

		/// <summary>
		/// 新密码
		/// </summary>
		[Required(ErrorMessage = "新密码不能为空")]
		[StringLength(20, MinimumLength = 5, ErrorMessage = "密码需要大于5个字符")]
		public string PasswordNew { get; set; }
	}

	public class ResetPwdUserInput : BaseIdInput
	{
	}
}
